package main

import (
	"fmt"
	"github.com/boltdb/bolt"
	"strings"
	"match-spider/util/boltdb"
)

func main()  {
	boltdb.ScanTx("matchs-2016", func(tx *bolt.Tx) {

		tx.ForEach(func(name []byte, b *bolt.Bucket) error {
			b.ForEach(func(k, v []byte) error {
				content:=string(v)
				s:=strings.Split(content,"^")

				league:=s[1]

				boltdb.Get("lastmatch-2016", league, string(k), func(text string) {
					fmt.Println(text)
				})
				return nil
			})
			return nil
		})

	})
}
